<%@ page import="java.util.ArrayList" %>
<%@ page import="TeachLesson.CourseWork.CourseWorkEnity" %>
<%@ page import="TeachLesson.CourseWork.CourseWorkDao" %>
<%@ page import="StudentLesson.StuCourseWorkDao" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/8/25
  Time: 18:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<%
    String workerNo=request.getParameter("workerNo");
    String courseNo=request.getParameter("courseNo");
%>
<head>
    <title>我的作业</title>
    <link href="/SystemerNav/SystemerNav.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body background="/LoginInterface/loginFace.jpg">
<div class="container">
    <div class="top">
        <ul class="nav nav-pills">
            <li role="presentation" class="active" ><a href="StudentLesson.jsp?courseNo=<%=request.getParameter("courseNo")%>&workerNo=<%=request.getParameter("workerNo")%>">首页</a></li>
            <li role="presentation"><a href="myWork.jsp?courseNo=<%=request.getParameter("courseNo")%>&workerNo=<%=request.getParameter("workerNo")%>" >我的作业</a></li>
            <li role="presentation"><a href="CourseResourse.jsp?courseNo=<%=request.getParameter("courseNo")%>&workerNo=<%=request.getParameter("workerNo")%>">课程资源</a></li>
        </ul>

        <table class="table table-hover">
            <tr>
                <td>作业名</td>
                <td>提交截至时间</td>
                <td>评分方式</td>
                <td>得分</td>
                <td>详情</td>
            </tr>
            <%
                CourseWorkDao courseWorkDao=new CourseWorkDao();
                ArrayList<CourseWorkEnity> list=courseWorkDao.getCourseWork(workerNo,courseNo);
                for(CourseWorkEnity temp:list){
                    StuCourseWorkDao stuCourseWorkDao=new StuCourseWorkDao();
                    String score= stuCourseWorkDao.getScore(temp.getId(),(String) session.getAttribute("studentNo"));
            %>
            <tr>
                <td><%=temp.getTitle()%></td>
                <td><%=temp.getEndTime()%></td>
                <td><%=temp.getEvaluteType()%></td>
                <td><%=score%></td>
                <td>
                    <form action="CourseWorkDetail.jsp" target="_blank">
                        <input type="hidden" name="id" value="<%=temp.getId()%>">
                        <button type="submit" class="btn btn-success">作业详情</button>
                    </form>
                </td>
            <%
                }%>
        </table>
    </div>
</div>
</body>
</html>
